export var creditManager={
    setTotalCredit:function(credit){
        localStorage.setItem('credit',JSON.stringify(credit))
    },
    getTotalCredit:function(){
        const credit = localStorage.getItem('credit');
        if(credit){
            return JSON.parse(credit)
        }
        return null
    },
    setCurrentCredit:function(credit){
        localStorage.setItem('currentCredit',JSON.stringify(credit))
    },
    getCurrentCredit:function(){
        const credit = localStorage.getItem('currentCredit');
        if(credit){
            return JSON.parse(credit)
        }
        return null
    },
    setCreditRecord:function(record){
        localStorage.setItem('creditRecord',JSON.stringify(record))
    },
    getCreditRecord:function(){
        const record = localStorage.getItem('creditRecord');
        if(record){
            return JSON.parse(record)
        }
        return null
    },
    
}